<template>
	<div>
		<el-button @click="read" size="default" class="mt15" type="primary">
			<SvgIcon name="iconfont icon-step" />
			读取
		</el-button>
	</div>
</template>
<script lang="ts">
import { toRefs, reactive, defineComponent } from 'vue'
import sm4 from '/@/utils/sm4'
export default defineComponent({
	name: 'sm4',
	setup() {
		const state = reactive({
			tableData: [],
			date: null,
		})
		const read = () => {
			alert('SM4加密ecb模式, 明文: Neusoft12#$, 密文, '+sm4.encrypt('Neusoft12#$'))
			alert('SM4加密ecb模式, 密文: '+ sm4.encrypt('Neusoft12#$') +', 明文, '+sm4.decrypt(sm4.encrypt('Neusoft12#$')))
		}
		return {
			read,
			...toRefs(state),
		};
	}
});
</script>